import java.util.Arrays;

public class Fast {
	public static void main(String[] args) {
		// rescale coordinates and turn on animation mode
        StdDraw.setXscale(0, 32768);
        StdDraw.setYscale(0, 32768);
        StdDraw.show(0);
		
		String filename = args[0];
        In in = new In(filename);
        int N = in.readInt();        
        Point[] arr = new Point[N];
        for (int i = 0; i < N; i++) {
            int x = in.readInt();
            int y = in.readInt();
            arr[i] = new Point(x, y);
            arr[i].draw();
        }

        for (int i=0; i<N-3; i++) {
        	Arrays.sort(arr, i, N);
        	Arrays.sort(arr, i+1, N, arr[i].SLOPE_ORDER);
        	for (int j=i+1; j<N-2; j++) {
        		int s;
        		boolean check = false;
        		double slope = arr[i].slopeTo(arr[j]);
        		for (s=1; j+s<N &&  slope == arr[i].slopeTo(arr[j+s]); s++); 
        		if (s >= 3) {
        			check = true;
        			for (int k=0; k<i;k++) 
        				if (arr[k].slopeTo(arr[i]) == slope) {
        					check = false;
        					break;
        				}
        		}
        		if (check == true) {
        			String out = arr[i].toString();
        			arr[i].drawTo(arr[j+s-1]);
        			for (int k=j; k<s+j; k++)
        				out += " -> " + arr[k];
					StdOut.println(out);						
        		}
        		j+=s-1;
        	}
        }
        StdDraw.show(0);      
	}
}